
void handleMsg()
{
	if (parsedVals.func == "SET")
	{
		if (parsedVals.var == "SSID")
		{
			//wlanSsid = parsedVals.value;
			for (int i = 0; i < sizeof(ssidCharBuf); ++i)
			{
				ssidCharBuf[i] = (char)0;
			}
			parsedVals.value.toCharArray(ssidCharBuf, 32);
			//wlanSsid.toCharArray(ssidCharBuf, 32);
			Serial.println(F("{\"PKG\":{\"ACK\":\"SSID\"}}"));
		}
		else if (parsedVals.var == "PW")
		{
			//wlanPass = parsedVals.value;
			for (int i = 0; i < sizeof(passCharBuf); ++i)
			{
				passCharBuf[i] = (char)0;
			}
			parsedVals.value.toCharArray(passCharBuf, 32);
			//wlanPass.toCharArray(passCharBuf, 32);
			Serial.println(F("{\"PKG\":{\"ACK\":\"PW\"}}"));
		}
		else if (parsedVals.var == "SEC") // Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2
		{

			wlanSecurity = parsedVals.value.toInt();
			//Serial.print(F("Security: ")); Serial.println(wlanSecurity);
			Serial.println(F("{\"PKG\":{\"ACK\":\"SEC\"}}"));
			credAvail = true;
		}
		else if (parsedVals.var == "BT")
		{
			Serial.println(F("{\"PKG\":{\"ACK\":\"BT\"}}"));
			BTAvail = true;
		}
		else if (parsedVals.var == "SERV")
		{
			//Serial.println(parsedVals.value);
			if (parsedVals.value == "CONNECT")
			{
				//UDPAvail = true;
				Serial.println(F("{\"PKG\":{\"ACK\":\"CONNECT\"}}"));
			}
		}
		else if (parsedVals.var == "MEM")
		{
			//Serial.println(parsedVals.value);
			if (parsedVals.value == "CLR")
			{
				for (int i = 0; i < sizeof(ssidCharBuf); ++i)
				{
					ssidCharBuf[i] = (char)0;
				}
				for (int i = 0; i < sizeof(passCharBuf); ++i)
				{
					passCharBuf[i] = (char)0;
				}

				memCleared = true;
				//Serial.println(F("MemClr"));
			}
		}
	}
	else if (parsedVals.func == "GET")
	{
		if (parsedVals.var == "TPS")
		{
			sendState = true;
		}
		else if (parsedVals.var == "BAT")
		{
			//TODO: return battery level
		}
	}
	else if (parsedVals.func == "ACK")
	{
		if (parsedVals.var == "IP")
		{
			//TODO: disable BT
		}
	}
}

